package org.gitman.agentplatform.ui.actions;

import java.awt.event.ActionEvent;

import org.gitman.agentplatform.core.exceptions.NoGraphException;
import org.gitman.agentplatform.ui.api.View;
import org.gitman.agentplatform.ui.api.View.MessageType;
import org.gitman.agentplatform.ui.utils.ResourcesLoader;

public class StepAction extends UIAction{

	public StepAction() {
		super(null, ResourcesLoader.getInstance().getIcon("step.png"));
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		try {
			platformManager.getSimulation().doStep();
		} catch (NoGraphException e1) {
			View.showMessage(e1.getMessage(), MessageType.ERROR);
		}		
	}

}
